package com.sdsmusic.playlist;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.sdsmusic.Song.SongVO;
import com.sdsmusic.controller.Controller;
import com.sdsmusic.member.MemberVO;

public class DeleteListController implements Controller {

	@Override
	public String handleRequest(HttpServletRequest request) {
		HttpSession session = request.getSession();
		MemberVO member = (MemberVO) session.getAttribute("member");

		String[] song_id_list = request.getParameterValues("song_id");
		if (song_id_list != null) {
			for (String song_id : song_id_list) {
				SongVO song = new SongVO();
				song.setSongId(Integer.parseInt(song_id));
				int rs = new PlaylistDAO().deleteSong(member, song);
			}
		}
		return "/SDSMusic/main.jsp";

	}

}
